package org.xtext.runtime.cartago;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import org.xtext.runtime.formula.Predicate;
import cartago.ArtifactId;

public class ArtifactStore {
    private Map<String, Predicate> observableProperties = new HashMap<String, Predicate>();

    public void storeArtifactProperties(ArtifactId id, Map<String, Object> properties) {
		
	}

    public void storeObservableProperty( String identifier, Predicate property ) {
        observableProperties.put( identifier, property );
    }
    
    public void removeObservableProperty( String identifier ) { 
    	observableProperties.remove( identifier );    	
    }
    
    public Predicate getObservableProperty( String identifier ) {
        for ( Entry<String, Predicate> entry : observableProperties.entrySet() ) {
            if ( entry.getValue().identifier().equals( identifier ) ) {
                return entry.getValue();
            }
        }

        return null;
    }
}
